import { MockMethod } from 'vite-plugin-mock';
import { mock } from 'mockjs';
export default [
  {
    url: '/JZ/GetJZKanBan',
    method: 'get',
    response: () => {
      console.log('s');
      return mock(demoList());
    },
  },
] as MockMethod[];

function demoList() {
  const result: any[] = [];
  for (let i = 0; i < 10; i++) {
    result.push({
      wgName: '@string(10)',
      dateString: '2023-08-08',
      footerString1: '@string(10)',
      footerString2: '@string(10)',
      footerString3: '@string(10)',
      currentSaleOrder: {
        SaleOrderNo: '@string(10)',
        StyleCode: '@string(7)',
        FinishedDate: '2023-08-08',
        SoQuantity: '@integer(10000,99999)',
        CSewQuantity: '@integer(10000,99999)',
        CSewTodayQuantity: '@integer(10000,99999)',
        TargetQuantity: '@integer(10000,99999)',
        QC6Percent: '@integer(10000,99999)',
        QC9Percent: '@integer(10000,99999)',
      },
      'chart1Data|30': [
        {
          ProcedureCode: '@increment(1)',
          FinishedPercentage: '@integer(1,99)',
        },
      ],
      'chart2Data|5': [
        {
          ColText: '@string(10)',
          CSewQuantity: '@integer(1000,9999)',
          TargetQuantity: '@integer(1000,9999)',
          Percent: '@integer(1,99)',
        },
      ],
      'chart3Data|5': [
        {
          Question6: '@string(6)',
          Quantity6: '@integer(1000,9999)',
          Percent6: '@integer(1,99)',
          Question9: '@string(6)',
          Quantity9: '@integer(1000,9999)',
          Percent9: '@integer(1,99)',
        },
      ],
    });
  }
  return result;
}
